<case value="kindeditor">
    <textarea name="{$[type]form.name}" id="[type]{$group_k}_kindeditor_{$[type]k}" class="form-control" {$[type]form.extra_attr}>
        {$[type]form.value}
    </textarea>
    <!-- <script type="text/javascript" src="__PUBLIC__/libs/kindeditor/kindeditor-min.js" charset="utf-8"></script>-->
    <script type="text/javascript">
	$.getScript("__PUBLIC__/libs/kindeditor/kindeditor-min.js",function(){
		/*
		渲染编辑器到textarea时，无法加载default.css及JS汉化文件。
		原因为_getBasePath方法是通过document.getElementsByTagName('script')来获取的kindeditor-all.js文件路径
		正确获取到BasePath,需要设置KindEditor.basePath
		http://kindeditor.net/view.php?bbsid=4&postid=6206
		*/
		KindEditor.basePath = '__PUBLIC__/libs/kindeditor/'; 	//
		KindEditor.create('#[type]{$group_k}_kindeditor_{$[type]k}', {
			allowFileManager : true,
			filePostName : 'file',
			width : '100%',
			height : '500px',
			cssPath : [
				'__PUBLIC__/libs/bootstrap/dist/css/bootstrap.min.css',
				'__PUBLIC__/libs/kindeditor/plugins/code/prettify.css'
			],
			resizeType: 1,
			pasteType : 2,
			urlType : 'absolute',
			fileManagerJson : '{:U(C("MODULE_MARK")."/PublicUpload/fileManager")}',
			uploadJson : '{:U(C("MODULE_MARK")."/PublicUpload/upload")}',
			remoteImgSaveUrl: '{:U(C("MODULE_MARK")."/PublicUpload/downremoteimg")}',
			extraFileUploadParams: {
				session_id : '{:session_id()}'
			},
			afterBlur: function(){this.sync();},
			autoSaveMode:true,
			autoSaveInterval:100,
			afterCreate: function() {
				this.loadPlugin('autosave');
			}
		});
    });
	
    </script>

</case>